/*
 * Created on 2005-7-1
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.linkage.util.exception;

import com.linkage.util.log.Logger;
/**
 * @author Administrator
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
@SuppressWarnings("serial")
public class UtilException extends BaseException {
	public UtilException(){
	}
	public UtilException(Exception e){
		if(e instanceof BaseException){
			this.setSuperException((BaseException)e);
		}else{
			setException(e);
			setErrorLevel(UTILLEVEL);
			setDetailMessage(UTILERRORINFO);
			log = Logger.getLogger();
			printErrorStackTrace(log,e);
//			log.error(e.getStackTrace().toString());
		}
	}
	public UtilException(Exception e, String className){
		if(e instanceof DAOException){
			this.setSuperException((BaseException)e);
		}else{
			setException(e);
			setErrorLevel(UTILLEVEL);
			setDetailMessage(UTILERRORINFO);
			log = Logger.getLogger(className);
			printErrorStackTrace(log,e);
//			log.error(e.getStackTrace().toString());
		}
	}
	public UtilException(Exception e, Class<?> c){
		if(e instanceof DAOException){
			this.setSuperException((BaseException)e);
		}else{
			setException(e);
			setErrorLevel(UTILLEVEL);
			setDetailMessage(UTILERRORINFO);
			log = Logger.getLogger(c);
			printErrorStackTrace(log,e);
		}
	}
}
